package com.lock.lock_common.api.productApi;

import com.github.pagehelper.PageInfo;
import com.lock.lock_common.dto.Result;
import com.lock.lock_common.pojo.ProductDiscounts;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

public interface ProductDiscountsApi {
    //单个商品优惠策略分页（参数：map中必须包含当前页数，可包含优惠名，商品id，优惠类型，优惠状态【正在进行，已结束，未开始】）
    @RequestMapping("/discountsPaging")
    Result<PageInfo<ProductDiscounts>> discountsPaging(@RequestBody Map<String, Object> map);
    /**
     * 所有商品优惠策略分页
     * @param map（参数：map中必须包含当前页数，可包含优惠名，优惠类型，优惠状态【正在进行，已结束，未开始】）
     * @return  Result<PageInfo<ProductDiscounts>>
     */
    @RequestMapping("/discountsPagingAll")
    Result<PageInfo<ProductDiscounts>> discountsPagingAll(@RequestBody Map<String, Object> map);

    //添加商品优惠
    @RequestMapping("/addDiscounts")
    Result<Integer> addDiscounts(@RequestBody ProductDiscounts discounts);

    //修改商品优惠
    @RequestMapping("/updDiscounts")
    Result<Integer> updDiscounts(@RequestBody ProductDiscounts discounts);

    //删除优惠
    @RequestMapping("/delDiscounts")
    Result<Integer> delDiscounts(@RequestParam Integer discountsId);

}
